<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLyRateTable extends Migration
{
    /**
     * Run the migrations.
     * author wjb
     * 彩票概率相关统计表(此表针对当天)
     * @return void
     */
    public function up()
    {
        Schema::create('ly_rate', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('number')->comment("期号(场次)");
            $table->tinyInteger('num')->comment("号码0,1,2,3...根据可选号码");
            $table->tinyInteger('current_win')->default(0)->comment("该号本期是否命中：0未1中");
            $table->tinyInteger('real_times')->comment("当日本期实出次数");
            $table->tinyInteger('should_times')->comment("理论次数");
            $table->float('appear_rate')->default('0.00')->comment("出现频率");
            $table->float('average_miss')->default('0.00')->comment("平均遗漏");
            $table->tinyInteger('max_miss')->comment("最大遗漏");
            $table->tinyInteger('previous_miss')->comment("上期遗漏");
            $table->tinyInteger('current_miss')->comment("本期遗漏");
            $table->float('desire_rate')->default('0.00')->comment("欲出几率");
            $table->float('invest_rate')->default('0.00')->comment("投资价值");
            $table->tinyInteger('backswing')->comment("回摆：1反向2重复3正向");
            $table->tinyInteger('even_number')->comment("单双：1单2双");
            $table->tinyInteger('size')->comment("大小：1小2大");
            $table->tinyInteger('scope')->comment("龙虎：1龙(首位大于尾位)2虎");
            $table->timestamps();


            //建立索引
            $table->index('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ly_rate');
    }
}
